package com.example.controller;


import com.example.model.Employee;
import com.example.service.EService;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/api/Controller")
public class Controller {

    private final EService eService;

    public Controller(EService eService) {
        this.eService = eService;
    }


    @GetMapping
    public ResponseEntity<List<Employee>> getAllEmployees() {
        return ResponseEntity.ok(eService.getAllEmployees());
    }





}
